package com.ibeeking.gmc.global.g.rest.controller.v1.feign;

import com.ibeeking.found.common.annotation.LoginUser;
import com.ibeeking.found.common.entity.CurrentUser;
import com.ibeeking.gmc.global.g.rest.service.ITenantDataAuthService;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName TenantDataAuthController控制器
 * @Description 租户间数据授权申请
 * @Author ibeeking
 * @Date 2020-12-02 15:29
 **/
@RestController
@RequestMapping("/b/dataAuth/feign/v1")
public class TenantDataAuthFeignController {

    @Resource
    private ITenantDataAuthService tenantDataAuthServiceImpl;

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "有效授权租户id列表")
    @PostMapping(value = "/listTenantId")
    public List<Integer> listTenantId(@LoginUser CurrentUser currentUser) {
        return tenantDataAuthServiceImpl.listTenantId(currentUser);
    }
}
